//
//  UITabBarController.swift
//  Documentation
//
//  Created by Toj on 2/7/23.
//

/**
 UITabBarController manages a button bar and transition view, for an application with multiple top-level modes.
 
 To use in your application, add its view to the view hierarchy, then add top-level view controllers in order.
 Most clients will not need to subclass UITabBarController.

 If more than five view controllers are added to a tab bar controller, only the first four will display.
 The rest will be accessible under an automatically generated More item.
 
 UITabBarController is rotatable if all of its view controllers are rotatable.
 */
@available(iOS 2.0, *)
open class UITabBarController : UIViewController, UITabBarDelegate, NSCoding {

    
    open var viewControllers: [UIViewController]?

    // If the number of view controllers is greater than the number displayable by a tab bar, a "More" navigation controller will automatically be shown.
    // The "More" navigation controller will not be returned by -viewControllers, but it may be returned by -selectedViewController.
    open func setViewControllers(_ viewControllers: [UIViewController]?, animated: Bool)

    
    unowned(unsafe) open var selectedViewController: UIViewController? // This may return the "More" navigation controller if it exists.

    open var selectedIndex: Int

    
    open var moreNavigationController: UINavigationController { get } // Returns the "More" navigation controller, creating it if it does not already exist.

    open var customizableViewControllers: [UIViewController]? // If non-nil, then the "More" view will include an "Edit" button that displays customization UI for the specified controllers. By default, all view controllers are customizable.

    
    @available(iOS 3.0, *)
    open var tabBar: UITabBar { get } // Provided for -[UIActionSheet showFromTabBar:]. Attempting to modify the contents of the tab bar directly will throw an exception.

    
    weak open var delegate: UITabBarControllerDelegate?
}

public protocol UITabBarControllerDelegate : NSObjectProtocol {

    
    @available(iOS 3.0, *)
    optional func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool

    @available(iOS 2.0, *)
    optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController)

    
    @available(iOS 3.0, *)
    optional func tabBarController(_ tabBarController: UITabBarController, willBeginCustomizing viewControllers: [UIViewController])

    @available(iOS 3.0, *)
    optional func tabBarController(_ tabBarController: UITabBarController, willEndCustomizing viewControllers: [UIViewController], changed: Bool)

    @available(iOS 2.0, *)
    optional func tabBarController(_ tabBarController: UITabBarController, didEndCustomizing viewControllers: [UIViewController], changed: Bool)

    
    @available(iOS 7.0, *)
    optional func tabBarControllerSupportedInterfaceOrientations(_ tabBarController: UITabBarController) -> UIInterfaceOrientationMask

    @available(iOS 7.0, *)
    optional func tabBarControllerPreferredInterfaceOrientationForPresentation(_ tabBarController: UITabBarController) -> UIInterfaceOrientation

    
    @available(iOS 7.0, *)
    optional func tabBarController(_ tabBarController: UITabBarController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?

    
    @available(iOS 7.0, *)
    optional func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning?
}

extension UIViewController {

    
    open var tabBarItem: UITabBarItem! // Automatically created lazily with the view controller's title if it's not set explicitly.

    
    open var tabBarController: UITabBarController? { get } // If the view controller has a tab bar controller as its ancestor, return it. Returns nil otherwise.
}

